﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pages_StageAreaModifyHistory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }

    }

    private void LoadData()
    {
        string stageIdString = Request["id"];
        if (string.IsNullOrEmpty(stageIdString))
        {
            throw new Exception("参数不正确：期ID为空");
        }
        string formatID = Request["formatID"];
        if (string.IsNullOrEmpty(formatID))
        {
            throw new Exception("参数不正确：业态ID为空");
        }

        dynamic stageAreaModifyHistoryInfo = PKURG.CostSplit.Business.BusinessTypeArea.GetStageAreaModfiyHistoryTopInfo(stageIdString, formatID);

        if (stageAreaModifyHistoryInfo != null)
        {
            tbAreaModifyInfo.Text = stageAreaModifyHistoryInfo.Txt;
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string stageIdString = Request["id"];
        if (string.IsNullOrEmpty(stageIdString))
        {
            throw new Exception("参数不正确：期ID为空");
        }
        string formatID = Request["formatID"];
        if (string.IsNullOrEmpty(formatID))
        {
            throw new Exception("参数不正确：业态ID为空");
        }
        PKURG.CostSplit.Business.BusinessTypeArea.AddStageAreaModfiyHistory(stageIdString, formatID, tbAreaModifyInfo.Text, "", "", "");
        ScriptManager.RegisterClientScriptBlock(this, typeof(string), "1", "alert('保存完成')", true);
    }
}